//
//  TYZSystemDialog.h
//  TYZ_SC
//
//  Created by 李贤立 on 2017/12/21.
//  Copyright © 2017年 Capfer. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 *  系统弹框类型
 */
typedef NS_ENUM(NSInteger, TYZSystemDialogType) {
    /**显示确认和取消*/
    SystemDialogType_Default = 0,
    /**显示确认和取消，着重确认*/
    SystemDialogType_Destructive_Left = 1,
    /**显示确认和取消，着重取消*/
    SystemDialogType_Destructive_Right = 2,
    /**只显示确认*/
    SystemDialogType_OneSure = 3,
    /**只显示确认，着重确认*/
    SystemDialogType_Destructive_Center = 4,
    
    /**显示多行（最多支持6个）*/
    SystemDialogType_More = 5,
    
    /**自定义选择（同默认效果）*/
    SystemDialogType_Custem_Default = 6,
    /**自定义选择（同1，左边着重）*/
    SystemDialogType_Custem_Destructive_Left = 7,
    /**自定义选择（同2，右边着重）*/
    SystemDialogType_Custem_Destructive_Right = 8,
    /**自定义选择（同3，只显示一个）*/
    SystemDialogType_Custem_OneSure = 9,
    /**自定义选择（同4，一个也着重）*/
    SystemDialogType_Custem_Destructive_Center = 10
};

@interface TYZSystemDialog : UIAlertController
#pragma mark - Dialog
/**
 *  创建系统弹框
 *  默认悬浮中间，显示确认和取消
 *  @pram title      标题
 *  @pram complement 点击确认的回调
 */
+ (instancetype)dialogWithTitle:(NSString *)title complement:(void(^)(void))complement;
+ (instancetype)dialogWithViewController:(UIViewController *)viewController title:(NSString *)title complement:(void(^)(void))complement;
/**
 *  创建中间悬浮的系统弹框的类型
 *
 *  @pram title      标题
 *  @pram dialogType 弹框类型（只对前五种有效）
 *  @pram complement 点击确认的回调
 */
+ (instancetype)dialogWithTitle:(NSString *)title dialogType:(TYZSystemDialogType)dialogType complement:(void(^)(void))complement;
+ (instancetype)dialogWithViewController:(UIViewController *)viewController title:(NSString *)title dialogType:(TYZSystemDialogType)dialogType complement:(void(^)(void))complement;
/**
 *  根据传入的数据创建底部弹出的系统弹框的类型 点击选择第几个选项的回调
 *
 *  @pram title      标题
 *  @pram showData   显示的数据，弹框类型只是第六种，从底部弹出
 *  @pram complement 点击确认的回调
 */
+ (instancetype)dialogWithTitle:(NSString *)title showData:(NSArray<NSString *> *)showData complement:(void(^)(NSInteger index))complement;
+ (instancetype)dialogWithViewController:(UIViewController *)viewController title:(NSString *)title showData:(NSArray<NSString *> *)showData complement:(void(^)(NSInteger index))complement;
/**
 *  根据自定义传入的中间弹框选择的数据创建系统弹框的类型 点击选择第几个选项的回调
 *
 *  @pram title      标题
 *  @pram showData   显示的数据，弹框类型只是第六种，从底部弹出
 *  @pram dialogType 弹框类型（只对后五种有效）
 *  @pram complement 点击确认的回调
 */
+ (instancetype)dialogWithTitle:(NSString *)title showData:(NSArray<NSString *> *)showData dialogType:(TYZSystemDialogType)dialogType complement:(void(^)(NSInteger index))complement;
+ (instancetype)dialogWithViewController:(UIViewController *)viewController title:(NSString *)title showData:(NSArray<NSString *> *)showData dialogType:(TYZSystemDialogType)dialogType complement:(void(^)(NSInteger index))complement;
/**
 *  创建带输入框的非密码形式的弹框
 *
 *  @pram title         标题
 *  @pram placeholder   占位文本
 *  @pram textLength    输入字数上限
 *  @pram isCenter      是否居中
 *  @pram complement    点击确认的回调
 */
+ (instancetype)dialogWithTitle:(NSString *)title placeholder:(NSString *)placeholder textLenth:(NSInteger)textLength isCenter:(BOOL)isCenter complement:(void(^)(NSString *text))complement;
+ (instancetype)dialogWithViewController:(UIViewController *)viewController title:(NSString *)title placeholder:(NSString *)placeholder textLenth:(NSInteger)textLength isCenter:(BOOL)isCenter complement:(void(^)(NSString *text))complement;
/**
 *  创建带输入框的弹框
 *
 *  @pram title             标题
 *  @pram placeholder       占位文本
 *  @pram textLength        输入字数上限
 *  @pram isCenter          是否居中
 *  @pram secureTextEntry   是否是密码模式
 *  @pram complement        点击确认的回调
 */
+ (instancetype)dialogWithTitle:(NSString *)title placeholder:(NSString *)placeholder textLenth:(NSInteger)textLength isCenter:(BOOL)isCenter secureTextEntry:(BOOL)secureTextEntry complement:(void(^)(NSString *text))complement;
+ (instancetype)dialogWithViewController:(UIViewController *)viewController title:(NSString *)title placeholder:(NSString *)placeholder textLenth:(NSInteger)textLength isCenter:(BOOL)isCenter secureTextEntry:(BOOL)secureTextEntry complement:(void(^)(NSString *text))complement;

#pragma mark - LoadingView
/**
 *  创建完全默认的加载框
 */
+ (instancetype)showLoadingView;
/**
 *  隐藏加载框
 */
+ (void)hiddenLoadingView;
/**
 *  创建带输入框的弹框
 *
 *  @pram message         标题
 *  @pram timeInterval  超时时间
 */
+ (instancetype)loadingViewWithMessage:(NSString *)message timeInterval:(CGFloat)timeInterval;
/**
 *  获取当前控制器
 */
+ (UIViewController *)getCurrentViewController;
@end
